package com.langgan.login;

import android.app.Activity;
import android.content.res.Configuration;
import android.graphics.Paint;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.langgan.base.ARouterManager;
import com.langgan.base.mybase.BaseMvvmActivity;
import com.langgan.common.utils.AppUtils;
import com.langgan.common.utils.SpUtils;
import com.langgan.login.databinding.ActivityLoginBinding;
import com.langgan.login.mvvm.viewmodel.LoginVM;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Route(path = ARouterManager.GO_LOGINACT)
public class LoginActivity extends BaseMvvmActivity<LoginVM, ActivityLoginBinding> {


    //获取数据三种方式
    //1.通过Autowired注解表明key   &  需要在onCreate中调用ARouter.getInstance().inject(this);配合使用
    @Autowired(name = "msg")
    public String msg;



    @Override
    protected void afterCreate() {
        int sdkVersion = AppUtils.getSDKVersion();
        Log.i(TAG, "afterCreate: "+sdkVersion);
        new LeakThread().start();
    }

    class LeakThread extends Thread {
        @Override
        public void run() {
            try {
                Thread.sleep(6 * 60 * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }


    @Override
    protected int getLayoutId() {
        return R.layout.activity_login;
    }

    @Override
    public void onConfigurationChanged(@NonNull Configuration newConfig) {
        if (newConfig.orientation==Configuration.ORIENTATION_LANDSCAPE){
            //如果是横屏了，在这里设置横屏的UI

        }else{
            //否则，在这里设置竖屏的UI
        }
        super.onConfigurationChanged(newConfig);


    }
}